//
//  HTTravelDetailModel.m
//  HeartTravel
//
//  Created by lanou on 15/10/31.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "HTTravelDetailModel.h"
#import "HTWaypointsModel.h"

@implementation HTTravelDetailModel

- (instancetype)init {
    
    if (self = [super init]) {
        _waypoints = [NSMutableArray arrayWithCapacity:0];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"waypoints"]) {
        for (NSDictionary *modelDic in value) {
    
            HTWaypointsModel *model = [[HTWaypointsModel alloc] init];
            [model setValuesForKeysWithDictionary:modelDic];
            [_waypoints addObject:model];
        }
        
    } else {
        [super setValue:value forKey:key];
    }
    
}

@end
